Class symantec.itools.awt.StateCheckBox
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.StateCheckBox

Object
   |
   +----Component
           |
           +----Canvas
                   |
                   +----symantec.itools.awt.StateCheckBox

public class StateCheckBox
extends Canvas
A two- or three-state checkbox that doesn't have an associated text label. A two-state checkbox behaves just like the standard checkbox. In three-state mode clicking the checkbox can switch the checkbox to a third state that appears both gray and checked.

The third state is often used to indicate that an attribute of the current selection varies across the selected items. For example, a checkbox used to indicate "bold text" might use the third state if the currently selected text included both bold and plain characters.

It is also used to indicate a default action or state.

Version:
1.0, Nov 26, 1996
Author:
Symantec

Variable Index

 o STATE_CHECKED
A state constant indicating that the current state is "checked".
 o STATE_DEFAULT
A state constant indicating that the current state is "default".
 o STATE_UNCHECKED
A state constant indicating that the current state is "unchecked".
 o THREE_STATE
A style constant indicating that this is a three-state checkbox.
 o TWO_STATE
A style constant indicating that this is a two-state checkbox.
 o actionListener
The action listener to keep track of listeners for our action event.
 o changes
Handles tracking non-vetoable change listeners and notifying them of each change to this component's properties.
 o mouse
The this component's mouse event listener.
 o vetos
Handles tracking vetoable change listeners and notifying them of each change to this component's properties.

Constructor Index

 o symantec.itools.awt.StateCheckBox()
Constructs a two-state StateCheckBox that is currently unchecked.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o getState()
Gets the current checkbox state: unchecked, checked, or default.
 o getStyle()
Gets the current style: two-state or three-state.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this button.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o reshape(int, int, int, int)
Moves and/or resizes this component.
 o sendActionEvent()
Sends an action performed event to any action listeners, as needed.
 o setState(int)
Sets the current checkbox state to unchecked, checked, or default.
 o setStyle(int)
Sets the current style to two-state or three-state.

Variables

 o STATE_CHECKED
public static final int STATE_CHECKED
A state constant indicating that the current state is "checked".

 o STATE_DEFAULT
public static final int STATE_DEFAULT
A state constant indicating that the current state is "default". Default is the third state of a three-state checkbox.

 o STATE_UNCHECKED
public static final int STATE_UNCHECKED
A state constant indicating that the current state is "unchecked".

 o THREE_STATE
public static final int THREE_STATE
A style constant indicating that this is a three-state checkbox.

 o TWO_STATE
public static final int TWO_STATE
A style constant indicating that this is a two-state checkbox.

 o actionListener
protected java.awt.event.ActionListener actionListener
The action listener to keep track of listeners for our action event.

 o changes
protected symantec.itools.beans.PropertyChangeSupport changes
Handles tracking non-vetoable change listeners and notifying them of each change to this component's properties.

 o mouse
protected symantec.itools.awt.StateCheckBox. Mouse mouse
The this component's mouse event listener.

 o vetos
protected symantec.itools.beans.VetoableChangeSupport vetos
Handles tracking vetoable change listeners and notifying them of each change to this component's properties.

Constructors

 o StateCheckBox
public StateCheckBox()
Constructs a two-state StateCheckBox that is currently unchecked.

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this button.

Parameters:
l - the action listener
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer.

Overrides:
addNotify in class Canvas
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removeVetoableChangeListener
 o getState
public int getState()
Gets the current checkbox state: unchecked, checked, or default.

Returns:
the current state: STATE_UNCHECKED, STATE_CHECKED, or STATE_DEFAULT
See Also:
getState, STATE_UNCHECKED, STATE_CHECKED, STATE_DEFAULT
 o getStyle
public int getStyle()
Gets the current style: two-state or three-state.

Returns:
the current StateCheckBox style; either TWO_STATE or THREE_STATE
See Also:
setStyle, TWO_STATE, THREE_STATE
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Canvas
See Also:
repaint, update
 o preferredSize
public java.awt.Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component. If this component has been reshaped, then the width and height of that request are returned.

Overrides:
preferredSize in class Component
See Also:
minimumSize
 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this button.

Parameters:
l - the action listener
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents.

Overrides:
removeNotify in class Component
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addVetoableChangeListener
 o reshape
public void reshape(int x,
                    int y,
                    int width,
                    int height)
Moves and/or resizes this component. This is a standard Java AWT method which gets called to move and/or resize this component. Components that are in containers with layout managers should not call this method, but rely on the layout manager instead. It is overriden here to note the requested width and height.

Parameters:
x - horizontal position in the parent's coordinate space
y - vertical position in the parent's coordinate space
width - the new width
height - the new height
Overrides:
reshape in class Component
 o sendActionEvent
protected void sendActionEvent()
Sends an action performed event to any action listeners, as needed.

 o setState
public void setState(int newState) throws PropertyVetoException
Sets the current checkbox state to unchecked, checked, or default.

Parameters:
newState - the new state: STATE_UNCHECKED, STATE_CHECKED, or STATE_DEFAULT
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getState, STATE_UNCHECKED, STATE_CHECKED, STATE_DEFAULT
 o setStyle
public void setStyle(int newStyle) throws PropertyVetoException
Sets the current style to two-state or three-state.

Parameters:
newStyle - new StateCheckBox state; either TWO_STATE or THREE_STATE
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getStyle, TWO_STATE, THREE_STATE

All Packages  Class Hierarchy  This Package  Previous  Next  Index